<?php

class Friend_favorite extends CI_Model {

    var $friend_id = '';
    var $friend_books = '';
    var $friend_movies = '';
    var $friend_music = '';
    var $friend_matchbooks = '';
    var $friend_matchmovies = '';
    var $friend_matchmusic = '';

    function __construct() {
        // Call the Model constructor
        parent::__construct();
    }
    function setAttribute($friend_id, $friend_books, $friend_movies, $friend_music, $friend_matchbooks, $friend_matchmovies, $friend_matchmusic) {
        $this->friend_id = $friend_id; // please read the below note
        $this->friend_books = $friend_books;
        $this->friend_movies = $friend_movies;
        $this->friend_music = $friend_music;
        $this->friend_matchbooks = $friend_matchbooks;
        $this->friend_matchmovies = $friend_matchmovies;
        $this->friend_matchmusic = $friend_matchmusic;
    }
    function update_friend($friend_id, $friend_books, $friend_movies, $friend_music, $friend_matchbooks, $friend_matchmovies, $friend_matchmusic) {
        $this->setAttribute($friend_id, $friend_books, $friend_movies, $friend_music, $friend_matchbooks, $friend_matchmovies, $friend_matchmusic);
        $this->db->where('friend_id', $friend_id);
        $this->db->update('friend_favorite', $this);
    }
    function insert_friend($friend_id, $friend_books, $friend_movies, $friend_music, $friend_matchbooks, $friend_matchmovies, $friend_matchmusic) {
        $this->setAttribute($friend_id, $friend_books, $friend_movies, $friend_music, $friend_matchbooks, $friend_matchmovies, $friend_matchmusic);
        $this->db->insert('friend_favorite', $this);
    }
}